DECLARE @staNoStr VARCHAR(84),@staNo VARCHAR(4)
DECLARE @strBegin int
declare @sql_create_table varchar(8000)
SET @staNoStr='A301A302A305A310A313A314A315A316A317A325A326A327A328A329A335A350A351A352A354A357A660'
  CREATE TABLE [dbo].[T3R4] (
	[DATE] [datetime] NOT NULL ,
	[STANO] [smallint] NULL ,
	[TMAX]  [smallint] NULL ,
	[TMIN]  [smallint] NULL ,
	[RR]    [smallint] NULL 
  ) ON [PRIMARY]

SET @strBegin=1
WHILE(@strBegin<83)
  BEGIN
  SET @staNo=SUBSTRING(@staNoStr,@strBegin,@strBegin+3) 
  SET @sql_create_table='CREATE TABLE '+@staNo+' (
	[Date] [datetime] PRIMARY KEY NOT NULL ,
	[N] [tinyint] NULL ,
	[VV] [smallint] NULL ,
	[T] [smallint] NULL ,
	[Td] [smallint] NULL ,
	[dd] [tinyint] NULL ,
	[ff] [tinyint] NULL ,
	[WW] [tinyint] NULL ,
	[UU] [tinyint] NULL ,
	[eee] [smallint] NULL ,
	[P] [float] NULL ,
	[P0] [float] NULL ,
	[Nh1] [tinyint] NULL ,
	[hh1] [smallint] NULL ,
	[Nh2] [tinyint] NULL ,
	[hh2] [smallint] NULL ,
	[Nh3] [tinyint] NULL ,
	[hh3] [smallint] NULL ,
	[Nh4] [tinyint] NULL ,
	[hh4] [smallint] NULL ,
	[Nh5] [tinyint] NULL ,
	[hh5] [smallint] NULL ,
	[Nh6] [tinyint] NULL ,
	[hh6] [smallint] NULL 
  ) ON [PRIMARY]'
  exec(@sql_create_table) 
  SET @strBegin=@strBegin+4  
  END
